package com.example.common.entity.base;

import com.baomidou.mybatisplus.annotation.*;
import lombok.EqualsAndHashCode;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 基类entity
 * @author huangjie
 * @create 2025/8/27
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class BaseEntity implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    protected Long id;

    @TableField(value = "deleted", select = false)
    @TableLogic
    protected Integer deleted = Integer.valueOf(0); // 0-未删除，1-已删除

    @TableField(value = "createTime", fill = FieldFill.INSERT)
    protected LocalDateTime createTime;

    @TableField(value = "updateTime", fill = FieldFill.UPDATE)
    protected LocalDateTime updateTime;
}
